﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BSCMFF.Core.DataAccessLayer;

namespace BSCMFF.Web.UserControls.Evaluation
{
    /// <summary>
    /// Fill personal KPI details.
    /// </summary>
    /// <remarks></remarks>
    public partial class FillPKPIDetail : System.Web.UI.UserControl
    {
        private Personal_KPI _pkpi;

        /// <summary>
        /// Gets or sets the PKPI.
        /// </summary>
        /// <value>The PKPI.</value>
        /// <remarks></remarks>
        public Personal_KPI PKPI
        {
            get
            {
                if (_pkpi == null)
                {
                    _pkpi = new Personal_KPI();
                    _pkpi.Name = RadTextBoxName.Text;
                    _pkpi.Description = RadTextBoxDescription.Text;
                    
                    return _pkpi;
                }
                else
                {
                    return _pkpi;
                }
            }
            set
            {
                _pkpi = value;
            }
        }

        /// <summary>
        /// Gets the KP i_ ID.
        /// </summary>
        /// <remarks></remarks>
        public int KPI_ID
        {
            get
            {
                return Int32.Parse(HiddenKPI_ID.Value);
            }
        }

        /// <summary>
        /// Gets the name.
        /// </summary>
        /// <remarks></remarks>
        public String Name
        {
            get
            {
                return RadTextBoxName.Text;
            }
        }

        /// <summary>
        /// Gets the description.
        /// </summary>
        /// <remarks></remarks>
        public String Description
        {
            get
            {
                return RadTextBoxDescription.Text;
            }
        }

        /// <summary>
        /// Gets the measure.
        /// </summary>
        /// <remarks></remarks>
        public String Measure
        {
            get
            {
                return RadTextBoxMeasure.Text;
            }
        }

        /// <summary>
        /// Gets the weight.
        /// </summary>
        /// <remarks></remarks>
        public int Weight
        {
            get
            {
                return (int)RadNumericTextBoxWeight.Value;
            }
        }

        /// <summary>
        /// Gets the start value.
        /// </summary>
        /// <remarks></remarks>
        public int? StartValue
        {
            get
            {
                return (int?)RadNumericTextBoxStartValue.Value;
            }
        }

        /// <summary>
        /// Gets the target value.
        /// </summary>
        /// <remarks></remarks>
        public int? TargetValue
        {
            get
            {
                return (int?)RadNumericTextBoxTargetValue.Value;
            }
        }

        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// <remarks></remarks>
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }
    }
}